var express = require('express');
var router = express.Router();
const query = require('./mysql');

/* post login listing. */
router.get('/', async function (req, res, next) {
	let sqlStr = 'select * from college';
	// sqlArr = [user.username, user.password];
	let result = await query(sqlStr);

	if (result.length != 0) {
		res.send({
			status: 200,
			message: '获取学院信息成功',
			result,
		});
	} else {
		res.send({ status: 404, message: '获取学院信息失败' });
	}
});

module.exports = router;
